from random import randint
from time import time

def merge(a, b):
    c = []
    h = j = 0
    while j < len(a) and h < len(b):
        if a[j] < b[h]:
            c.append(a[j])
            j += 1
        else:
            c.append(b[h])
            h += 1

    if j == len(a):
        for i in b[h:]:
            c.append(i)
    else:
        for i in a[j:]:
            c.append(i)

    return c


def merge_sort(lists):
    if len(lists) <= 1:
        return lists
    middle = len(lists)/2
    left = merge_sort(lists[:middle])
    right = merge_sort(lists[middle:])
    return merge(left, right)


if __name__ == '__main__':
    n = int(input())
    data = [randint(0,n*n)for i in xrange(n)]
    print 'begin:'
    print ' running...'
    t1 = int(time()*1000)
    res = merge_sort(data)
    t2 = int(time()*1000)
    print 'end.'
    # print res
    print 'run time: %dms'%(t2-t1)
    p = True
    for i in xrange(n-1) :
        if res[i]>res[i+1] :
            p = False
            break
    print 'the answer is '+('right'if p else 'wrong')+' !!!'
